package vip.specimen.web.config;

import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;
import java.util.List;

/**
 * *@Author: 余浪人
 * *@Date：2021/4/1 17:21
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Configuration
@EnableSwagger2
@EnableSwaggerBootstrapUI
public class WebSwaggerConfig {
    @Bean
    public Docket createWebApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(webApiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("vip.specimen.web.controller"))
                .paths(PathSelectors.any())
                .build().groupName("前台接口API");
    }

    private ApiInfo webApiInfo() {
        return new ApiInfoBuilder()
                .title("specimen综合管理系统前台API接口文档")
                .description("specimen管理系统")
                .contact(new Contact("余浪人", "http://www.specimen.vip", "1368419640@qq.com"))
                .version("1.0")
                .build();
    }
}